package com.teyao.teyao_back.controller;


import com.teyao.teyao_back.config.myPage;
import com.teyao.teyao_back.entity.CarClientWrapper;
import com.teyao.teyao_back.entity.ResponseMessage;
import com.teyao.teyao_back.service.CarClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@RequestMapping("/carClient")
public class CarClientController {
    @Autowired
    private CarClientService carClientService;

    @GetMapping("/getAll")
    public ResponseMessage getAll() {
        return carClientService.getAll();
    }


    @GetMapping("/driverOrder")
    public myPage driverOrder(Integer currentPage, Integer size, CarClientWrapper carClientWrapper) {
        return carClientService.myQuery(currentPage, size, carClientWrapper);
    }

    @GetMapping("/driverOrderAlready")
    public myPage driverOrderAlready(Integer currentPage, Integer size, CarClientWrapper carClientWrapper) {
        return carClientService.alreadyQuery(currentPage, size, carClientWrapper);
    }
}
